package cpt202.project.mapper;

import cpt202.project.dao.BookMapper;
import cpt202.project.entity.Book;
import cpt202.project.entity.Record;
import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.Repeat;
import org.springframework.test.annotation.Timed;

@SpringBootTest
public class BookMappertest {

    @Autowired
    private BookMapper bookMapper;

    @Test
    public void getDefaultBidTest() {
        Integer result = bookMapper.getDefaultBid("1163387462@qq.com");
    }

    @Test
    public void getAllBidTest(){
        Book[] books = bookMapper.getAllBid("test@test.com");
        System.out.println(books);
    }

    @Test
    public void addBookTest(){
        Book book = new Book("1163387462@qq.com", "西天取经");
        Integer result = bookMapper.addBook(book);
        System.out.println(result);
    }

    @Test
    public void deleteBook(){
        bookMapper.deleteBook(11);
        Integer result = bookMapper.isExist(11);
        System.out.println(result);
    }

}
